package com.hzj.controller;

import com.hzj.pojo.PaymentInfo;
import com.hzj.service.PaymentInfoService;
import com.hzj.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/consumer/admin/order/paymentInfo/")
public class PaymentInfoController {

    @Autowired
    private PaymentInfoService pis;

    @PostMapping("queryPaymentInfo")
    public Result queryPaymentInfo(){
        return pis.queryPaymentInfo();
    }

    @PostMapping("updatePaymentInfo")
    public Result updatePaymentInfo(@RequestBody PaymentInfo paymentInfo){
        return pis.updatePaymentInfo(paymentInfo);
    }

    @PostMapping("deletePaymentInfo/{outTradeNo}")
    public Result deletePaymentInfo(@PathVariable String outTradeNo){
        return pis.deletePaymentInfo(outTradeNo);
    }

    @PostMapping("querPaymentInfoByOrderId/{orderId}")
    public Result querPaymentInfoByOrderId(@PathVariable Integer orderId){
        return Result.ok(pis.querPaymentInfoByOrderId(orderId));
    }
}
